<?php
namespace User\Controller;
//我的优惠券
use Common\Controller\MemberbaseController;
use Common\ModelSQ\CommMSQ;

class CouponController extends MemberbaseController {

    public function _initialize() {
        parent::_initialize();
    }

    public function index(){
        $msq = new CommMSQ();
        $list = $msq->getMyCoupon(cookie('user_name'), 0, 10, 1);
        $this->assign('orderlist',$list);
        $this->display();
    }

    public function read(){
        $status = empty(I('get.status'))?'0':I('get.status');
        $pageSize = empty(I('get.pageSize'))?'10':I('get.pageSize');
        $pageIndex = empty(I('get.pageIndex'))?'1':I('get.pageIndex');
        $msq = new CommMSQ();
        $list = $msq->getMyCoupon(cookie('user_name'), $status, $pageSize, $pageIndex);
        $this->ajaxReturn($list);
    }

}


